home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / e.dxr / 00007_#E02 -carMap.ls < prev    next >
Encoding:
Text File  |  1996-02-15  |  18.1 KB  |  441 lines

  1. global gEnvironmentSound, gOBJECTSE, gObjects, gStates, NULLrect, gHotRects, gScreenstate, gCursorlist, gWorld, gGlobal, sQTSPRITE, sQTCharSprite
  2.  
  3. on trunc number
  4.   set newNumber to number + 0.5
  5.   if integer(newNumber) > integer(number) then
  6.     return integer(number)
  7.   else
  8.     return integer(number) - 1
  9.   end if
  10. end
  11.  
  12. on carDrive gasStationNum
  13.   if the shiftDown and (gGlobal = 1) and (gasStationNum = 15) then
  14.     doGoToFork()
  15.   else
  16.     set carMapObj to getaProp(gObjects, #carMap)
  17.     set curScale to getaProp(carMapObj, #curScale)
  18.     set curZone to getaProp(carMapObj, #curZone) / power(5, 3 - curScale)
  19.     set curZone to trunc(curZone)
  20.     set nextStationZone to getaProp(getaProp(gObjects, value("#carMapGasStn" & gasStationNum)), #zone)
  21.     if nextStationZone <= curZone then
  22.       exit
  23.     end if
  24.     set fuelLevel to getaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel)
  25.     if fuelLevel = 0 then
  26.       Jumptokey(#E01)
  27.       exit
  28.     end if
  29.     set keyFrme1 to value("#EG" & curScale)
  30.     set withinRangeList to getOne(getaProp(getaProp(carMapObj, #gasWithinRnge), value("#level" & curScale)), curZone)
  31.     set newZone to integer(getaProp(carMapObj, #curZone) + (fuelLevel * power(5, 3 - curScale)))
  32.     setaProp(carMapObj, #curZone, newZone)
  33.     if (fuelLevel < 5) or (withinRangeList = 0) then
  34.       set keyFrme2 to value("#E" & curScale & fuelLevel)
  35.       set newDashCast to the number of cast string("E" & curScale & fuelLevel & ".pct")
  36.       setaProp(getaProp(gObjects, #CarGasGauge), #towLength, fuelLevel)
  37.       setaProp(getaProp(gObjects, #carEmerPar), #State, #stranded)
  38.       set runoutCount to getaProp(getaProp(gObjects, #CarGasGauge), #runoutCount) + 1
  39.       MakeDynamic(#CarGasGauge, #runoutCount, runoutCount)
  40.       if runoutCount < 5 then
  41.         set State to value("#E03tow" & runoutCount)
  42.       else
  43.         set State to #E03tow6
  44.       end if
  45.       MakeDynamic(#TowTruckDriverQT, #State, State)
  46.       MakeDynamic(#TowTruckDriverQT, #DisplayState, State)
  47.     else
  48.       if (curScale = 1) and (curZone = 10) then
  49.         set keyFrme2 to #EFK
  50.         set newDashCast to the number of cast "EFK.pct"
  51.         set initList to [#lookAtPelletDispenser]
  52.         set killList to [#carLookLeft, #carLookRight]
  53.         changeHotSpots(initList, killList, #false)
  54.         setaProp(getaProp(gObjects, #carEmerPar), #State, #off)
  55.       else
  56.         set keyFrme2 to value("#E" & curScale & 6)
  57.         set newDashCast to the number of cast ("EG" & curScale & ".pct")
  58.         setaProp(getaProp(gObjects, #CarGasGauge), #towLength, 0)
  59.         set initList to [#carLookRight]
  60.         set killList to []
  61.         changeHotSpots(initList, killList, #false)
  62.         setaProp(getaProp(gObjects, #carEmerPar), #State, #off)
  63.         setaProp(getaProp(gObjects, #GasManQT), #droveOrTowed, #drove)
  64.       end if
  65.     end if
  66.     set movieLength to the duration of cast (keyFrme1 & "_" & keyFrme2 & ".mov") - 20
  67.     setaProp(getaProp(gObjects, #MapCarGasGauge), #movieTimePerZone, movieLength / fuelLevel)
  68.     if not (the shiftDown) then
  69.       set the locH of sprite getaProp(getaProp(gObjects, #transCarDashView), #SpriteNum) to 280
  70.       set the locH of sprite getaProp(getaProp(gObjects, #carDashPict), #SpriteNum) to 280
  71.       set the locH of sprite getaProp(getaProp(gObjects, #MapCarGasGauge), #SpriteNum) to 283
  72.     end if
  73.     set dashObj to getaProp(gObjects, #carDashView)
  74.     setaProp(getaProp(dashObj, #cast), #UP, newDashCast)
  75.     set dashObj to getaProp(gObjects, #TowCarDashView)
  76.     setaProp(getaProp(dashObj, #cast), #UP, newDashCast)
  77.     MakeDynamic(#TowCarDashView, #cast, getaProp(getaProp(gObjects, #TowCarDashView), #cast))
  78.     set newDashCast to the number of cast string("EG" & curScale & ".pct")
  79.     set dashSprite to getaProp(getaProp(gObjects, #transCarDashView), #SpriteNum)
  80.     set the castNum of sprite dashSprite to newDashCast
  81.     updateStage()
  82.     genExitKFE(keyFrme1, keyFrme2, "Drive")
  83.     MakeDynamic(#CarDash, #State, #off)
  84.     changeGasGauge(1, #false)
  85.   end if
  86. end
  87.  
  88. on doGoToFork
  89.   setaProp(getaProp(gObjects, #carMap), #curZone, 15 * 25)
  90.   set newDashCast to the number of cast "EFK.pct"
  91.   set initList to [#lookAtPelletDispenser]
  92.   set killList to [#carLookLeft, #carLookRight]
  93.   changeHotSpots(initList, killList, #false)
  94.   setaProp(getaProp(gObjects, #carEmerPar), #State, #off)
  95.   set dashObj to getaProp(gObjects, #carDashView)
  96.   setaProp(getaProp(dashObj, #cast), #UP, newDashCast)
  97.   MakeDynamic(#CarDash, #State, #off)
  98.   setaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel, 0)
  99.   changeGasGauge(1, #false)
  100.   Jumptokey(#E01)
  101.   stopsound("E01idle.aif")
  102.   abort()
  103. end
  104.  
  105. on putLocs
  106.   put the loc of sprite 20 & " ΓÇóLoc of DashViewΓÇó"
  107.   put the rect of sprite 48 & " ΓÇóRect of 48ΓÇó"
  108.   put the frame & " ΓÇócur Frame NumΓÇó"
  109. end
  110.  
  111. on DoTransitionForE LastKeyRef, NextKeyRef
  112.   SetTransMovie(LastKeyRef, NextKeyRef)
  113.   set gPlayingQT to 1
  114.   onOffScreenCursor(0)
  115.   set the movieTime of sprite sQTSPRITE to 0
  116.   set the rect of sprite sQTSPRITE to rect(0, 0, 560, 188)
  117.   set gLastCursor to getaProp(gCursorlist, #NullCursor)
  118. end
  119.  
  120. on genExitKFE LastKeyRef, NextKeyRef, driveOrTow
  121.   set the movieRate of sprite sQTCharSprite to 0
  122.   set the loc of sprite sQTCharSprite to point(-9999, -9999)
  123.   set func to getaProp(getaProp(gCurKeyList, #FUNCTIONS), #exit)
  124.   if func <> #NOEXIT then
  125.     do(string(func))
  126.   end if
  127.   setKFGlobals(#E01)
  128.   if the shiftDown then
  129.     changeGasGauge(1, #false)
  130.     setaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel, 0)
  131.     go("KeyFrame")
  132.   else
  133.     DoTransitionForE(LastKeyRef, NextKeyRef)
  134.     if driveOrTow = "Drive" then
  135.       go("DriveQT")
  136.       set objsToDel to [#carMapSeg1, #carMapSeg2, #carMapSeg3, #carMapURHere, #carMapBg, #carMapPanLft, #carMapPanRt, #carMapZoomIn, #carMapZoomOut, #scaleDesc, #distanceIndicator, #carMapGasStn1, #carMapGasStn2, #carMapGasStn3, #carMapGasStn4, #carMapGasStn5, #carMapGasStn6, #carMapGasStn7, #carMapGasStn8, #carMapGasStn9, #carMapGasStn10, #carMapGasStn11, #carMapGasStn12, #carMapGasStn13, #carMapGasStn14, #carMapGasStn15]
  137.       DelObjects(objsToDel)
  138.     else
  139.       playSound("E01towgo.aif", #File, 1)
  140.       set whichChannel to the result
  141.       repeat while soundBusy(whichChannel) = 1
  142.       end repeat
  143.       go("TowQT")
  144.     end if
  145.     playSound("E01drive.aif", #cast, 0)
  146.   end if
  147.   stopsound("E01idle.aif")
  148. end
  149.  
  150. on DocarMapPanLft
  151.   scrollMap("left")
  152. end
  153.  
  154. on DocarMapPanRt
  155.   scrollMap("right")
  156. end
  157.  
  158. on DocarMapZoomIn
  159.   if getaProp(getaProp(gObjects, #carMap), #curScale) = 3 then
  160.     exit
  161.   end if
  162.   changeScale("plus")
  163. end
  164.  
  165. on DocarMapZoomOut
  166.   if getaProp(getaProp(gObjects, #carMap), #curScale) = 1 then
  167.     exit
  168.   end if
  169.   changeScale("minus")
  170. end
  171.  
  172. on setMapPos
  173.   set carMap to getaProp(gObjects, #carMap)
  174.   set OBj to getaProp(gObjects, #carMapPanLft)
  175.   set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #loc)
  176.   set curHotRect to getAt(getaProp(OBj, #Hotrect), 1)
  177.   setaProp(getaProp(gHotRects, value(getaProp(OBj, #SpriteNum) & "01")), #rect, curHotRect)
  178.   set OBj to getaProp(gObjects, #carMapPanRt)
  179.   set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #loc)
  180.   set curHotRect to getAt(getaProp(OBj, #Hotrect), 1)
  181.   setaProp(getaProp(gHotRects, value(getaProp(OBj, #SpriteNum) & "01")), #rect, curHotRect)
  182.   set newURHereLoc to getaProp(getaProp(gObjects, #carMapURHere), #loc)
  183.   set the loc of sprite getaProp(getaProp(gObjects, #carMapURHere), #SpriteNum) to newURHereLoc
  184.   set mapV to getaProp(carMap, #mapsV)
  185.   set startcast to getaProp(carMap, #startcast)
  186.   set map1H to getaProp(carMap, #map1H)
  187.   repeat with X = 0 to 2
  188.     set whichMap to getaProp(gObjects, value("#carMapSeg" & X + 1))
  189.     set mapSpriteNum to getaProp(whichMap, #SpriteNum)
  190.     set the castNum of sprite mapSpriteNum to startcast + X
  191.     set the locH of sprite mapSpriteNum to map1H + (X * 208)
  192.   end repeat
  193.   updateMapHtRcts()
  194. end
  195.  
  196. on setMapVar
  197.   set carMap to getaProp(gObjects, #carMap)
  198.   set curScale to getaProp(carMap, #curScale)
  199.   set curZone to getaProp(carMap, #curZone) / power(5, 3 - curScale)
  200.   set curZone to trunc(curZone)
  201.   set curZone to trunc(curZone)
  202.   set dotOffset to getAt(getaProp(getaProp(carMap, #levelHLocs), value("#level" & curScale)), curZone + 1)
  203.   set dotV to getAt(getaProp(getaProp(carMap, #levelVLocs), value("#level" & curScale)), curZone + 1)
  204.   set scaleEnd to 2080 * power(5, curScale - 2)
  205.   if dotOffset < 209 then
  206.     set dotH to dotOffset + 72
  207.     set startcast to getaProp(getaProp(carMap, #levelStrtCast), value("#level" & curScale))
  208.     set map1H to 176
  209.     set OBj to getaProp(gObjects, #carMapPanLft)
  210.     setaProp(OBj, #Hotrect, [NULLrect])
  211.     setaProp(OBj, #loc, point(-9999, 147))
  212.     set OBj to getaProp(gObjects, #carMapPanRt)
  213.     setaProp(OBj, #Hotrect, [getAt(getaProp(OBj, #hotRect2), 1)])
  214.     setaProp(OBj, #loc, point(513, 147))
  215.   else
  216.     if dotOffset > (scaleEnd - 209) then
  217.       set dotH to 488 - (scaleEnd - dotOffset)
  218.       set startcast to getaProp(getaProp(carMap, #levelEndCast), value("#level" & curScale)) - 2
  219.       set map1H to -32
  220.       set OBj to getaProp(gObjects, #carMapPanLft)
  221.       setaProp(OBj, #Hotrect, [getAt(getaProp(OBj, #hotRect2), 1)])
  222.       setaProp(OBj, #loc, point(47, 147))
  223.       set OBj to getaProp(gObjects, #carMapPanRt)
  224.       setaProp(OBj, #Hotrect, [NULLrect])
  225.       setaProp(OBj, #loc, point(-9999, 147))
  226.     else
  227.       set startcast to getaProp(getaProp(carMap, #levelStrtCast), value("#level" & curScale)) + integer(dotOffset / 208) - 1
  228.       set map1H to 176 - (dotOffset mod 208)
  229.       set adjustment to map1H mod getaProp(carMap, #scrollStepSize)
  230.       set map1H to map1H - adjustment
  231.       set dotH to 280 - adjustment
  232.       set OBj to getaProp(gObjects, #carMapPanLft)
  233.       setaProp(OBj, #Hotrect, [getAt(getaProp(OBj, #hotRect2), 1)])
  234.       setaProp(OBj, #loc, point(47, 147))
  235.       set OBj to getaProp(gObjects, #carMapPanRt)
  236.       setaProp(OBj, #Hotrect, [getAt(getaProp(OBj, #hotRect2), 1)])
  237.       setaProp(OBj, #loc, point(513, 147))
  238.     end if
  239.   end if
  240.   if curScale = 1 then
  241.     set map1H to 176
  242.     set startcast to getaProp(getaProp(carMap, #levelStrtCast), #level1)
  243.     set OBj to getaProp(gObjects, #carMapPanLft)
  244.     setaProp(OBj, #Hotrect, [NULLrect])
  245.     setaProp(OBj, #loc, point(-9999, 147))
  246.     set OBj to getaProp(gObjects, #carMapPanRt)
  247.     setaProp(OBj, #Hotrect, [NULLrect])
  248.     setaProp(OBj, #loc, point(-9999, 147))
  249.   end if
  250.   setaProp(getaProp(gObjects, #carMapURHere), #loc, point(dotH, dotV))
  251.   set mapV to getaProp(carMap, #mapsV)
  252.   repeat with X = 0 to 2
  253.     set whichMap to getaProp(gObjects, value("#carMapSeg" & X + 1))
  254.     set mapSpriteNum to getaProp(whichMap, #SpriteNum)
  255.     setaProp(getaProp(whichMap, #cast), #UP, startcast + X)
  256.     setaProp(whichMap, #loc, point(map1H + (X * 208), mapV))
  257.   end repeat
  258.   setaProp(carMap, #startcast, startcast)
  259.   setaProp(carMap, #map1H, map1H)
  260.   set seg1Obj to getaProp(gObjects, #carMapSeg1)
  261.   set map1SprtLft to map1H - 104
  262.   set seg1Cast to getaProp(getaProp(seg1Obj, #cast), #UP)
  263.   set startcast to getaProp(carMap, #levelStrtCast)
  264.   set leftEdgeH to map1SprtLft - ((seg1Cast - getaProp(startcast, value("#level" & curScale))) * 208)
  265.   setaProp(carMap, #leftEdge, leftEdgeH)
  266.   updateMapHtRectVars()
  267. end
  268.  
  269. on scrollMap whichWay
  270.   set carMap to getaProp(gObjects, #carMap)
  271.   set curScale to getaProp(carMap, #curScale)
  272.   if whichWay = "right" then
  273.     set direction to -1
  274.     set edgeLoc to getaProp(carMap, #lftLimit)
  275.     set edgeCast to getaProp(getaProp(carMap, #levelEndCast), value("#level" & curScale))
  276.     set OBj to getaProp(gObjects, #carMapPanLft)
  277.     setaProp(getaProp(gHotRects, value(getaProp(OBj, #SpriteNum) & "01")), #rect, getAt(getaProp(OBj, #hotRect2), 1))
  278.     set the locH of sprite getaProp(OBj, #SpriteNum) to 47
  279.     setaProp(OBj, #loc, point(47, 147))
  280.     set scrollObj to getaProp(gObjects, #carMapPanRt)
  281.   else
  282.     set direction to 1
  283.     set edgeLoc to getaProp(carMap, #rtLimit)
  284.     set edgeCast to getaProp(getaProp(carMap, #levelStrtCast), value("#level" & curScale))
  285.     set OBj to getaProp(gObjects, #carMapPanRt)
  286.     setaProp(getaProp(gHotRects, value(getaProp(OBj, #SpriteNum) & "01")), #rect, getAt(getaProp(OBj, #hotRect2), 1))
  287.     set the locH of sprite getaProp(OBj, #SpriteNum) to 513
  288.     setaProp(OBj, #loc, point(513, 147))
  289.     set scrollObj to getaProp(gObjects, #carMapPanLft)
  290.   end if
  291.   set the castNum of sprite getaProp(scrollObj, #SpriteNum) to getaProp(getaProp(scrollObj, #cast), #down)
  292.   set URHereSprteNum to getaProp(getaProp(gObjects, #carMapURHere), #SpriteNum)
  293.   set atEdge to 0
  294.   set OffsetH to 3 * direction * -1
  295.   repeat while the stillDown
  296.     repeat with X = 1 to 3
  297.       set whichMap to getaProp(gObjects, value("#carMapSeg" & X))
  298.       set whichSprite to getaProp(whichMap, #SpriteNum)
  299.       set curH to the locH of sprite whichSprite
  300.       set newH to curH + (direction * 16)
  301.       set curCast to the castNum of sprite whichSprite
  302.       set the locH of sprite whichSprite to newH
  303.       setaProp(whichMap, #loc, point(newH, 156))
  304.       if (newH = edgeLoc) or (curH = edgeLoc) then
  305.         if (curCast + (2 * direction * -1)) <> edgeCast then
  306.           set newCastNum to curCast + OffsetH
  307.           set the castNum of sprite whichSprite to newCastNum
  308.           setaProp(getaProp(whichMap, #cast), #UP, newCastNum)
  309.           set newCastH to the locH of sprite whichSprite + (getaProp(carMap, #offset) * OffsetH)
  310.           set the locH of sprite whichSprite to newCastH
  311.           setaProp(whichMap, #loc, point(newCastH, 156))
  312.           next repeat
  313.         end if
  314.         if direction = -1 then
  315.           set OBj to getaProp(gObjects, #carMapPanRt)
  316.           setaProp(getaProp(gHotRects, value(getaProp(OBj, #SpriteNum) & "01")), #rect, NULLrect)
  317.           set the locH of sprite getaProp(OBj, #SpriteNum) to -9999
  318.           setaProp(OBj, #loc, point(-9999, 147))
  319.         else
  320.           set OBj to getaProp(gObjects, #carMapPanLft)
  321.           setaProp(getaProp(gHotRects, value(getaProp(OBj, #SpriteNum) & "01")), #rect, NULLrect)
  322.           set the locH of sprite getaProp(OBj, #SpriteNum) to -9999
  323.           setaProp(OBj, #loc, point(-9999, 147))
  324.         end if
  325.         set atEdge to 1
  326.       end if
  327.     end repeat
  328.     set newDotH to the locH of sprite URHereSprteNum + (direction * 16)
  329.     set the locH of sprite URHereSprteNum to newDotH
  330.     set leftEdgeH to getaProp(carMap, #leftEdge) + (direction * 16)
  331.     setaProp(carMap, #leftEdge, leftEdgeH)
  332.     updateStage()
  333.     if atEdge = 1 then
  334.       exit repeat
  335.     end if
  336.   end repeat
  337.   set the castNum of sprite getaProp(scrollObj, #SpriteNum) to getaProp(getaProp(scrollObj, #cast), #UP)
  338.   updateStage()
  339.   updateMapHtRectVars()
  340.   updateMapHtRcts()
  341. end
  342.  
  343. on changeScale plusOrMinus
  344.   set carMap to getaProp(gObjects, #carMap)
  345.   set smallRectSprt to getaProp(getaProp(gObjects, #smallRect), #SpriteNum)
  346.   set mapRectSprt to getaProp(getaProp(gObjects, #mapRect), #SpriteNum)
  347.   set the rect of sprite smallRectSprt to rect(274, 153, 286, 162)
  348.   set the rect of sprite mapRectSprt to rect(70, 19, 489, 294)
  349.   if plusOrMinus = "plus" then
  350.     set newScale to getaProp(carMap, #curScale) + 1
  351.     set startRect to smallRectSprt
  352.     set endRect to mapRectSprt
  353.   else
  354.     set newScale to getaProp(carMap, #curScale) - 1
  355.     set startRect to mapRectSprt
  356.     set endRect to smallRectSprt
  357.   end if
  358.   MakeDynamic(#carMap, #curScale, newScale)
  359.   changeMultistate(newScale, #scaleDesc)
  360.   changeMultistate(newScale, #distanceIndicator)
  361.   setMapVar()
  362.   setMapPos()
  363.   zoomBox(startRect, endRect, 3)
  364.   updateStage()
  365.   updateMapHtRectVars()
  366.   updateMapHtRcts()
  367. end
  368.  
  369. on updateMapHtRectVars
  370.   set carMap to getaProp(gObjects, #carMap)
  371.   set leftEdge to getaProp(carMap, #leftEdge)
  372.   set curScale to getaProp(carMap, #curScale)
  373.   set levels to [1, 2, 3]
  374.   deleteAt(levels, curScale)
  375.   set hotRectLists to getaProp(carMap, #levelHotRects)
  376.   set moveHotRects to getAt(hotRectLists, curScale)
  377.   set howmany to count(moveHotRects)
  378.   set mapRect to getaProp(carMap, #mapRect)
  379.   repeat with X = 1 to howmany
  380.     set gasStationNum to getAt(moveHotRects, X)
  381.     set gasStationObj to getaProp(gObjects, value("#carMapGasStn" & gasStationNum))
  382.     set currect to getAt(getaProp(gasStationObj, #hotRect2), 1)
  383.     set newRect to intersect(offset(currect, leftEdge - 72, 0), mapRect)
  384.     MakeDynamic(getaProp(gasStationObj, #RefName), #Hotrect, [newRect])
  385.   end repeat
  386.   repeat with X = 1 to 2
  387.     set whichRectList to getAt(hotRectLists, getAt(levels, X))
  388.     set howmany to count(whichRectList)
  389.     repeat with z = 1 to howmany
  390.       set gasStationObj to getaProp(gObjects, value("#carMapGasStn" & getAt(whichRectList, z)))
  391.       MakeDynamic(getaProp(gasStationObj, #RefName), #Hotrect, [NULLrect])
  392.     end repeat
  393.   end repeat
  394. end
  395.  
  396. on updateMapHtRcts
  397.   set carMap to getaProp(gObjects, #carMap)
  398.   set curScale to getaProp(carMap, #curScale)
  399.   set levels to [1, 2, 3]
  400.   deleteAt(levels, curScale)
  401.   set hotRectLists to getaProp(carMap, #levelHotRects)
  402.   set moveHotRects to getAt(hotRectLists, curScale)
  403.   set howmany to count(moveHotRects)
  404.   set mapRect to getaProp(carMap, #mapRect)
  405.   repeat with X = 1 to howmany
  406.     set gasStationNum to getAt(moveHotRects, X)
  407.     set gasStationObj to getaProp(gObjects, value("#carMapGasStn" & gasStationNum))
  408.     set currect to getAt(getaProp(gasStationObj, #Hotrect), 1)
  409.     setaProp(getaProp(gHotRects, value(string(59 + gasStationNum) & "01")), #rect, currect)
  410.   end repeat
  411.   repeat with X = 1 to 2
  412.     set whichRectList to getAt(hotRectLists, getAt(levels, X))
  413.     set howmany to count(whichRectList)
  414.     repeat with z = 1 to howmany
  415.       setaProp(getaProp(gHotRects, value(string(59 + getAt(whichRectList, z)) & "01")), #rect, NULLrect)
  416.     end repeat
  417.   end repeat
  418. end
  419.  
  420. on changeHotSpots initList, killList, onFrame
  421.   set z to count(initList)
  422.   repeat with X = 1 to z
  423.     set OBj to getaProp(gObjects, getAt(initList, X))
  424.     set Hotrect to getAt(getaProp(OBj, #hotRect2), 1)
  425.     set whichHotRect to value(getaProp(OBj, #SpriteNum) & "01")
  426.     if onFrame = #true then
  427.       setaProp(getaProp(gHotRects, whichHotRect), #rect, Hotrect)
  428.     end if
  429.     MakeDynamic(getaProp(OBj, #RefName), #Hotrect, value("[" & Hotrect & "]"))
  430.   end repeat
  431.   set z to count(killList)
  432.   repeat with X = 1 to z
  433.     set OBj to getaProp(gObjects, getAt(killList, X))
  434.     set whichHotRect to value(getaProp(OBj, #SpriteNum) & "01")
  435.     if onFrame = #true then
  436.       setaProp(getaProp(gHotRects, whichHotRect), #rect, NULLrect)
  437.     end if
  438.     MakeDynamic(getaProp(OBj, #RefName), #Hotrect, value("[" & NULLrect & "]"))
  439.   end repeat
  440. end
  441.